package 算法基础模板.chapter_03;

import java.util.Arrays;

/**
 * @author Summerday
 */
public class Graph {

    int[] e, ne, h;
    int idx, n;

    public Graph (int n) {
        this.n = n;
        e = new int[n + 10];
        ne = new int[n + 10];
        idx = 0;
        h = new int[n];
        Arrays.fill(h, -1);
    }

    public void add(int a, int b){
        e[idx] = b;
        ne[idx] = h[a];
        h[a] = idx ++;
    }
}
